export const timeSplit = <T extends Array<any>>(
    result: T,
    cb: Parameters<T["forEach"]>[0],
    sliceSize: number,
    gapTime = 100
) => {
    const count = Math.ceil(result.length / sliceSize);
    for (let index = 0; index <= count; index++) {
        setTimeout(() => {
            result
                .slice(index * sliceSize, sliceSize * (index + 1))
                .forEach(cb);
        }, index * gapTime);
    }
};
